package main

import "fmt"

func main() {
	data := "abc"
	i := make([]interface{}, 1)
	i[0] = data
	// i[0] 必须是interface 类型才能做类型判断
	if value, ok := i[0].(int); ok == true {
		fmt.Println("int", value)
	} else if value, ok := i[0].(string); true == ok {
		fmt.Println("string ", value)
	} else {
		fmt.Println("none")
	}

}
